Skip to content

Give AbstractNamedTensor a generic dimnametype default#225

Merged
mtfishman merged 1 commit into
mainfrom
mf/dimnametype-generic
Jul 21, 2026
Merged

Give AbstractNamedTensor a generic dimnametype default#225
mtfishman merged 1 commit into
mainfrom
mf/dimnametype-generic

Conversation

@mtfishman

Copy link
Copy Markdown
Member

Summary

dimnametype fell back to Any for any AbstractNamedTensor subtype that did not define its own method, so NamedTensorOperator reported Any even though it carries its dimname type as a parameter. That broke factorizations that mint a fresh bond name on an operator (qr_compact, svd, and friends), which minted the new name from Any.

Since AbstractNamedTensor{DimName} already carries the dimname type, the default reads it from the supertype, covering every subtype uniformly and subsuming the per-type methods on NamedTensor and SymbolicNamedTensor, which are removed. The Any fallback remains for a fully unparameterized AbstractNamedTensor.

`dimnametype` fell back to `Any` for any `AbstractNamedTensor` subtype that did not define its own method, so `NamedTensorOperator` reported `Any` even though it carries its dimname type as a parameter. That broke factorizations that mint a fresh bond name on an operator (`qr_compact`, `svd`, and friends), which minted the new name from `Any`.

Since `AbstractNamedTensor{DimName}` already carries the dimname type, the default reads it from the supertype, covering every subtype uniformly and subsuming the per-type methods on `NamedTensor` and `SymbolicNamedTensor`, which are removed. The `Any` fallback remains for a fully unparameterized `AbstractNamedTensor`.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.21%. Comparing base (06900c4) to head (1d0fb1e).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #225      +/-   ##
==========================================
- Coverage   77.23%   77.21%   -0.02%     
==========================================
  Files          29       29              
  Lines        1713     1712       -1     
==========================================
- Hits         1323     1322       -1     
  Misses        390      390              
Flag Coverage Δ
docs 27.20% <50.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mtfishman
mtfishman enabled auto-merge (squash) July 21, 2026 19:58
@mtfishman
mtfishman merged commit f748ab0 into main Jul 21, 2026
18 checks passed
@mtfishman
mtfishman deleted the mf/dimnametype-generic branch July 21, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant